Skip to content

Checkpoint work tasks, save uncommitted outcomes, and show status - #387

Closed
n0rpan wants to merge 21 commits into
agent/333-work-continuefrom
agent/333-work-state
Closed

n0rpan wants to merge 21 commits into
agent/333-work-continuefrom
agent/333-work-state

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Delivers step 3 of #333, stacked on #358. T2.

The runner saves staged, unstaged and untracked task work as a normal commit, including after failed checks. Hooks and the configured identity remain in force; rejected commits and unresolved conflicts retain all work and block the task. Atomic owner-only per-task checkpoints resume interrupted phases with their captured task/base/check commands. Completed tasks skip unless --rerun is explicit; --status prints ID, outcome, last progress time and current step.

Kernel locks survive a killed runner through agent, acceptance and saving subprocesses. Status probes ownership so an interrupted unlocked phase reports blocked without rewriting its checkpoint.

Validation at 94fb542 (normal merges of the updated step 2 and the maintainer's main update): 194 touched-crate tests pass, plus full-workspace fmt, strict all-target clippy and four unchanged scans. Actual SIGKILL/slow-hook regressions failed before their fixes. Tests use fake engines, real bwrap and local bare repositories.

No runner state format has shipped: #336/#358 are open. Required current-format fields remain strict under #331's explicit no-migration rule; unsupported files and retained worktrees are not overwritten or deleted.

@n0rpan
n0rpan marked this pull request as ready for review November 15, 2026 16:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T16:54:17.429779Z 77100aa Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77100aa4ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oxa/oxa-work/src/lib.rs Resolved
Comment thread oxa/oxa-work/src/lib.rs Resolved
* oxa-interactive: keep the location and mode in the HUD at 60 columns

Shrink the CTX bar and the model name before dropping the mode and the
cloud/local segment.

Refs #343

* oxa-interactive: HUD keeps location at 60 columns (fix drop loop)

Refs #343
…ale (#359)

* ui: add an explicit ascii skin (ui.skin / OXA_SKIN = ascii)

Refs #347

* ui: TERM=linux/dumb implies the ASCII glyph set even with a UTF-8 locale

Refs #347
@n0rpan

n0rpan commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → anthropic/claude-opus-5-5 at head 77100aa (O-241; the orchestrator adjudicates and enqueues).

Codex findings

  • lib.rs:227, old receipts not migrated: CONFIRMED. Record (lib.rs:38-46) now needs step and progress_at, and State also needs task and offline, with no serde defaults. So state::read (state.rs:59) fails on any receipt written before this change. That task is then always blocked, --rerun can't help because the read happens first (lib.rs:~227), and work --status fails for every task because of the ? in status().
  • lib.rs:253, saving subprocesses don't hold the task lock: CONFIRMED. save_work (execute.rs:104-124) receives no lock. It runs git add and git commit through checked(git(..)), and output() sets stdin to null (lib.rs:49). If the runner is killed during a slow commit hook, the lock is released while git keeps running. A restarted runner can then reacquire the lock and run the Saving step at the same time as the first commit.

Additional findings

  • oxa/oxa-work/src/lib.rs (status) and oxa/oxa-cli/src/work_cmd.rs:7: P3. --status reads receipts without checking the task lock. A runner that died stays reported as running <step> forever. Status can't tell a live task from a dead one, which partly defeats the "show status" goal. A non-blocking try_lock probe would tell them apart.

TIER: T2
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

n0rpan commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass REVISE answered: the saving-lock P2 and interrupted-status P3 are fixed with two failing-first regressions (real slow-hook/SIGKILL and a read-only status probe). All 191 touched-crate tests, fmt, strict clippy and four scans pass. The migration P2 is not applicable to this unreleased feature: #336/#358 remain open and #331 explicitly prohibits migration paths. Current-format validation stays strict and preserves unsupported files/worktrees; the inline reply cites that standing rule. Continuing publishing and queue work without a review wait.

@n0rpan

n0rpan commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → anthropic/claude-opus-5-5 at head f6321b0 (O-241; the orchestrator adjudicates and enqueues).

Codex findings

  • lib.rs:227 (migrate old receipts): CONFIRMED. state::read (state.rs:60) still parses the receipt into a full State. Record (lib.rs:38-46) now requires step and progress_at, State requires task and offline, and none of these fields has #[serde(default)]. There is no code to migrate the old format. A receipt written by the previous runner therefore fails with "task state: missing field …" in run_task_with_options (lib.rs:225), even with --rerun. It also fails in status (work --status stops at the first such file).
  • lib.rs:253 (lock not held during saving): FIXED. save_work now takes lock and gives every git subprocess stdin(lock.try_clone()) (execute.rs:109-112).

Additional findings

  • None confirmed beyond the receipt migration. I checked these and found no defect:
    • recovering from an interrupted step
    • the lock in status being held until the re-read
    • temporary receipt files not being read (the .json extension filter)
    • validate running before the save commit
    • nothing in the diff weakens a scanner, sandbox, permission or budget check

Defect

  • oxa/oxa-work/src/state.rs:60 / lib.rs:225, 285 (P2): a repository with any receipt from before this change can no longer continue that task or run oxa work --status. That task stays blocked for good unless someone deletes the receipt by hand. No test covers a receipt in the old format.

TIER: T2
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

* oxa-config: suggest the closest model id when --model is not found

Refs #381

* oxa-config: match suggestions on the id after the provider prefix

Refs #381
…failed every command) (#376)

* oxa-sandbox: skip git binds whose source vanished mid-session (bwrap failed every command)

The 'gh issue view --comments' empty-output half is a gh/mise matter, not oxa.

Refs #322

* sandbox: keep a vanished git dir unrecreatable (#322 review)

Codex P1 / review P2 confirmed: skipping only the missing gitdir left the common
dir bound writable, so the gitdir could be recreated with its own commondir/hooks.
A vanished rw git dir now makes all git binds read-only (also in
create_missing_git_files_homes). P3 confirmed: existence check follows symlinks, so
a dangling symlink is not bound. Test asserts no writable bind over the common dir.
No lab/ files are touched by this PR, nothing remains under lab/.
* sandbox: expose the running oxa binary read-only and as OXA_BIN

Refs #337

* sandbox: name the running binary OXA_RUNNING_BIN and do not bind it inside the workspace

Codex P2 #1 (real): a bind over a binary under the writable workspace makes it a
mount point, so a rebuild cannot replace it; it is now only named there.
Codex P2 #2 (real): OXA_BIN is the parity suite's explicit override; the sandbox
now exports OXA_RUNNING_BIN instead. The first-pass review found no defects.
No lab/ files remain (the rename to oxc/ was already merged).

* sandbox: skip the read-only exe bind under writable extra paths too, with a test (review finding 1+2)

n0rpan commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

The re-review at f6321b0 confirms the saving-lock fix and finds no further defect beyond migration. The migration request remains inapplicable under #331's standing rule, “No users yet: no legacy names, no migration paths, port or build current behaviour only.” Both predecessor PRs #336/#358 remain open; no released runner state format exists. Current-format checkpoints stay strict and unsupported files/worktrees stay intact. No migration code or test for an intermediate development format will be added.

* Add opt-in Anthropic event stream translator with final usage

* Add stream redactor hooks and require terminal output usage
* Add opt-in in-process gateway Engine adapter

* Honor cancellation during buffered reply finalization
@n0rpan

n0rpan commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → anthropic/claude-opus-5-5 at head 94fb542 (O-241; the orchestrator adjudicates and enqueues).

Codex findings

  • oxa/oxa-work/src/lib.rs:227 (old receipts not migrated): CONFIRMED. On the base branch, Record has only id/branch/worktree/outcome/detail. Now state::read (state.rs) deserializes a full State, which needs task, offline, checkpoint, step and progress_at, and none of these fields has a #[serde(default)]. If a receipt was written by the previous runner, run_task_with_options returns task state: missing field …, and --rerun doesn't help because the read happens before the rerun branch. oxa work --status also aborts entirely (status() uses ? on every receipt), so one old receipt hides the status of every task. Severity P2.
  • oxa/oxa-work/src/lib.rs:253 (lock not kept during saving): FIXED. In save_work (execute.rs), every git call made through run now gets lock.try_clone() as stdin, so git add and git commit and their hooks hold the task lock.

Additional findings

  • oxa/oxa-work/src/lib.rs status() (the try_lock on the .lock file): --status takes the task lock exclusively for a short time. If a runner starts that task at the same moment, state::lock fails with "task is already running". The task then records a blocked result even though nothing else is running it. P3.

TIER: T2
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

n0rpan and others added 5 commits November 15, 2026 20:08
…xci-pr) (#423)

Pull requests from this repository run their x86_64 jobs on a separate pool of the project's
runners when OXCI_PR is on, so they never take a runner the merge queue needs; fork pull
requests stay on the hosted images.


Claude-Session: https://claude.ai/code/session_01NazrMQ18AoZGWQ7NCTK6ie

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…omponents' heavy jobs) (#432)

* ci: path-aware merge queue (classify the group diff, skip untouched components' heavy jobs)

tools/ci/paths.py now diffs merge_group.base_sha..head_sha instead of treating a
merge group as every file; an empty group diff still counts as everything.
oxc-gateway/, oxc-rs/, conformance/ map to the controller (lab) component,
fuzz/oxa to oxa, fuzz/oxe to engine; other paths still mark everything.
build.yml gains engine/oxa inputs gating engine, flash and the oxa jobs via
job-level if (skipped jobs keep their required names); the lab job is gated
on the lab output in the queue. Manual and nightly runs are unchanged.
cloud-gateway.yml x86_64 jobs use the shared runner expression from checks.yml.

* ci: check that no workflow job names a hosted x86_64 image directly

tools/ci/tests/test_workflow_runners.py reads every workflow and fails when a
job's runs-on is not the hosted ARM image or the runner expression from
checks.yml (matrix x86 entries must be routed through it). release.yml and
release-build.yml are listed exceptions: published binaries are never built on
the project's runners. The failure message shows the expression to copy.

build.yml's x86 jobs now use the exact checks.yml expression (fallback
ubuntu-latest), and the experimental oxc CLI job moves to the expression too.
Check names are unchanged.

* ci tests: runner check follows the PR-pool expression

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NazrMQ18AoZGWQ7NCTK6ie

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…th checksums and provenance (#389)

* release: attach the combined aarch64 and x86_64 archives and SBOMs with checksums and provenance

Fixes #378

* release: map versioned archive to the Arch pkgver name; no cancel of called runs

Codex P1 (arch consumers) confirmed: arch-test.sh now copies ox-llm-v*-linux-<arch> to the
pkgver name the PKGBUILD expects (same bytes, same hash). Review findings 1 and 2 fixed with tests.
…es saved only on main (#444)

* ci: path-gate ready PRs, full main runs, one aggregate gate, main-only cache saves

- paths.py: outputs engine/oxa/lab/cli/gateway/md; oxc-rs and conformance map to cli,
  oxc-gateway to gateway (nothing under oxc/ reads them); push on main, nightly and manual
  runs set every component; PRs and the queue keep the diff result.
- checks.yml: ready PRs run the changed components (heavy on non-draft PRs), conditions on
  the classifier outputs only; classifier, scans, links, rustfmt and the oxa-tests aggregate
  on hosted ARM; gateway jobs moved in from cloud-gateway.yml (manual-only now); new gate job.
- Caches: actions/cache/restore everywhere, actions/cache/save only on main per key prefix.
- tests: test_paths updated, test_gate.py guards gate coverage, flags and cache placement.

* session replay: schema check works with jsonschema older than 4.18

The hosted x86_64 image ships a jsonschema without the referencing package; the
schema-validation path imported it unconditionally, so the controller suite errored
there (it only ever ran where jsonschema was absent and the test was skipped).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NazrMQ18AoZGWQ7NCTK6ie

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Add opt-in in-process gateway Engine adapter

* Honor cancellation during buffered reply finalization

* Exercise core tool loops through the embedded gateway
…357)

* TUI: reject unknown slash commands locally; add /help, /usage, /cost

Fixes #341

* slash: keep single-component absolute paths (/etc, /README.md) as prompts; test

* slash: /help and /usage yield to templates/extensions; drop misleading /cost; tests cover cx.commands and dotless unknown names

Codex single-component path finding: /etc and /README.md pass through; a dotless
nonexistent name (/srv) is ambiguous with a typo of a command, so it stays a local error
(issue #341 asks for exactly that); the test uses a name that cannot exist.

* slash: unknown-command error says how to send the line as text (//)

Review O-241 P3 (dotless missing path dropped): real; the // escape already
reached the core, so the error now names it and a test covers it.
P2 (/cost): /cost is deliberately not added (it showed no cost); the PR
title is stale, the code and test agree. Nothing lived under lab/.
Refs #341

* oxa: unknown slash with text goes to the model, host-independent

Review findings: a dotless single-name path (/src explain ...) was dropped
locally depending on the host filesystem, and the '//' escape did not
restore the line (the core keeps both slashes), so the hint was wrong.
Now only a bare unknown /name is rejected; a name followed by text is a
prompt. Filesystem check and the false '//' hint removed.
/cost: not a built-in (it would show no cost); the PR title should drop it.
Nothing under lab/; the change only touches oxa/.

* Register /help and /usage in the core command registry; test bare registered commands

Review findings: /help and /usage missing from the registry (autocomplete, /help descriptions) - fixed, registry test updated. Tests for /skill:demo and /deploy now use the bare form so the cx.commands lookup is exercised. /cost: no command is added on purpose (it shows no cost); the PR title needs changing, which is done on GitHub. The dotless-relative-name P3: a name followed by text already reaches the model; only a bare unknown name is rejected as a typo. lab/ was already renamed to oxc/ by main; nothing is left under lab/.
@n0rpan
n0rpan marked this pull request as draft November 15, 2026 21:13

n0rpan commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by main-based #692 at 43321ee, after #678 landed. The replacement carries the save supervisor's inherited task lock, adds a real parent-death-during-commit-hook regression, and makes status read-only with no flock syscall (fatal-seccomp proof). The new hook regression awaits full CI because this workspace currently refuses thread/fork creation; the earlier 319-test checkpoint run passed. Unsupported formats remain preserved/refused under #331's no-migration rule. Closing this stacked draft; its branch stays intact.

@n0rpan n0rpan closed this Nov 16, 2026
@oxa-orchestrator
oxa-orchestrator Bot deleted the agent/333-work-state branch November 17, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant